package com.itheima.admin.controller.v1;

import com.itheima.admin.service.DashboardService;
import com.itheima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Dashboard数据统计控制器
 * 
 * @author itheima
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/dashboard")
@Api(tags = "Dashboard数据统计")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    @GetMapping("/stats")
    @ApiOperation("获取Dashboard统计数据")
    public ResponseResult getStats() {
        return dashboardService.getStats();
    }

    @GetMapping("/trends")
    @ApiOperation("获取趋势数据")
    public ResponseResult getTrends() {
        return dashboardService.getTrends();
    }
}

